package com.itheima.a01;

import org.springframework.context.support.ResourceBundleMessageSource;

import java.util.Locale;

/**
 * 国际化资源处理类
 */
public class ResourceBundleMessageSourceDemo {
    public static void main(String[] args) {
        ResourceBundleMessageSource ms = new ResourceBundleMessageSource();
        ms.setDefaultEncoding("utf-8");
        ms.setBasename("messages");
        System.out.println(ms.getMessage("hi", null, Locale.ENGLISH));
        System.out.println(ms.getMessage("hi", null, Locale.CHINESE));
        System.out.println(ms.getMessage("hi", null, Locale.JAPANESE));
    }
}
